<?php
include("../connection/connection.php");
//include("reportFunctions.php");
//$distId=418;//$_REQUEST['distId']
//$sqlReport = "SELECT distinct `district_id`,`district_name` FROM `tbl_lookup_location`";
//$queryReport = mysql_query($sqlReport);

$sqlReport1 = "SELECT distinct `modify_date` FROM `tbl_dtls_user_history` order by `modify_date` desc";
$queryReport1 = mysql_query($sqlReport1);

function getUserCountQ1($date,$action_id)
{
$queryForm="SELECT count(action_id) FROM `tbl_dtls_user_history` where action_id='".$action_id."' and modify_date='".$date."'" ;
$resultForm=mysql_query($queryForm);
$x=mysql_fetch_row($resultForm);
return $x[0];
}

?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Report</title>
</head>
<body>
<table border="0" width="800" cellspacing="0" cellpadding="0">
	<tr>
		<td bgcolor="#E9E9E9" height="26">
		<p align="center">
		<font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">
		Date wise entry of forms </font>
		<div align="center"><span style="font-size: 9pt; font-weight: 700">
	        <font face="Verdana" color="#224568"> Table 3</font></span></div></td>
	</tr>
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="862" cellspacing="0" cellpadding="0" height="49">
			
			<tr bgcolor="#C5D8EB">
			  <td width="119" align="center">
			  <p align="center"><font style="font-size: 8.5pt" face="Verdana">Date</font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana">Q1</font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana">Q2</font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana">Q3</font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana">Total</font></td>
			</tr>
		 <?php  	
		 	while($rowReport1 = mysql_fetch_array($queryReport1)) {
			
			?>
			<tr bgcolor="#FFFFFF">
				<td width="119" align="center"><font style="font-size: 8.5pt" face="Verdana"><?php echo $rowReport1['modify_date']; ?></font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana"><?php echo getUserCountQ1($rowReport1['modify_date'],1);?></font></td>
				<td align="center" width="119" ><font style="font-size: 8.5pt" face="Verdana"><?php echo getUserCountQ1($rowReport1['modify_date'],2);?></font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana"><?php echo getUserCountQ1($rowReport1['modify_date'],3);?></font></td>
				<td align="center" width="119"><font style="font-size: 8.5pt" face="Verdana"><?php echo (getUserCountQ1($rowReport1['modify_date'],1)+getUserCountQ1($rowReport1['modify_date'],2)+getUserCountQ1($rowReport1['modify_date'],3));?></font></td>
			</tr>
			<?php
			}
			?>
		</table>
		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

